package ACM.dog;

/**
 * @Author wwk
 * @DATE 2022/8/27 19:23
 */
import java.util.*;
public class first {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        String s = scanner.next();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++){
            char c = s.charAt(i);
            if(i<k){
                if(Character.isLowerCase(c)){
                    sb.append(Character.toUpperCase(c));
                }else{
                    sb.append(c);
                }
            }else{
                if(Character.isUpperCase(c)){
                    sb.append(Character.toLowerCase(c));
                }else{
                    sb.append(c);
                }
            }
        }
        System.out.println(sb.toString());
    }
}
